import React from 'react'
import {useNavigate} from "react-router-dom"
import {ProductCard} from 'react-vant'
type Props = {
    childrenData:any
}

const Son = (props: Props) => {
    const navigate=useNavigate()
    const gotodeils=(val:any)=>{
     navigate("/deils/"+val.id,{state:val})
    }
  return (
    <div className='list'>
         {
            props.childrenData&&props.childrenData.map((item:any,index:number)=>{
           return   <ProductCard
           
           onClick={()=>gotodeils(item)}
           key={index}
           num={item.num}
           price={item.price}
           desc={item.info}
           title={item.title}
           thumb={item.img}
         />
            })
          }
    </div>
  )
}

export default Son